package com.one.service;

import com.one.util.RequestReturn;
import com.one.util.RequestReturnFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @ClassName: SubscribeProductService
 * @Auther: yph
 * @Date: 2022/1/19 09:42
 * @Description:
 */
@FeignClient("street-product")
public interface SubscribeProductService {

    /**
     * @Author: yph
     * @Date: 2022/1/19 09:43
     * @return: 
     * @Description: 订阅到货提醒的消息
    */
    @GetMapping("/product/subscribeAddProduct")
    RequestReturn<String> subscribeAddProduct(@RequestParam("phone") String phone,
                                              @RequestParam("productId") Integer productId);

    /**
     * @Author: yph
     * @Date: 2022/1/19 09:50
     * @return:
     * @Description: 根据id添加库存
     */
    @GetMapping("/product/addProduct")
    RequestReturn<Map<String,Object>> addProduct(@RequestParam("productId") Integer productId,@RequestParam("addNum") Integer addNum);


    /**
     * @Author: yph
     * @Date: 2022/1/18 15:12
     * @return:
     * @Description: 根据手机号查询收到的消息
     */
    @GetMapping("/product/receiveMessage")
    RequestReturn<String> receiveMessage(@RequestParam("phone") String phone);

    /**
     * @Author: yph
     * @Date: 2022/1/22 01:14
     * @return: 
     * @Description:  根据商品id 查看商品库存信息
    */
    @GetMapping("/product/queryProductStock")
    RequestReturn<Map<String, Object>> queryProductStock(@RequestParam("productId") Integer productId);
}
